﻿<UserControl xmlns:Extensions="clr-namespace:Sakura.Silverlight.Extensions;assembly=SLExtension" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:local="clr-namespace:Galnote.Control" x:Class="Galnote.Control.Management"
    mc:Ignorable="d"
    d:DesignHeight="600" d:DesignWidth="400"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:controlsPrimitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls">
    
    <UserControl.Resources>
        
        <!--DataPicker Style-->
        <Style x:Key="GenericDataPickerStyle" TargetType="sdk:DatePicker">
            <Setter Property="IsTabStop" Value="False" />
            <Setter Property="Background" Value="White" />
            <Setter Property="Padding" Value="2" />
            <Setter Property="SelectionBackground" Value="#FFB4B4B4" />
            <Setter Property="BorderBrush" Value="#FFB4B4B4"/>
            <Setter Property="BorderThickness" Value="0" />
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="sdk:DatePicker">
                        <Grid x:Name="Root">
                            <Grid.Resources>
                                <!-- Main DatePicker Brushes -->
                                <SolidColorBrush x:Key="DisabledBrush" Color="#8CFFFFFF" />

                                <!-- Button Template -->
                                <ControlTemplate x:Key="DropDownButtonTemplate" TargetType="Button">
                                    <Grid FlowDirection="LeftToRight">
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualStateGroup.Transitions>
                                                    <VisualTransition GeneratedDuration="0" />
                                                    <VisualTransition To="MouseOver" GeneratedDuration="0:0:0.1" />
                                                    <VisualTransition To="Pressed" GeneratedDuration="0:0:0.1" />
                                                </VisualStateGroup.Transitions>
                                                <VisualState x:Name="Normal" />
                                                <VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="0" Value="#7FFFFFFF" />
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="0" Value="#CCFFFFFF" />
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="0" Value="#F2FFFFFF" />
                                                        </ColorAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="0" Value="#EAFFFFFF" />
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="0" Value="#C6FFFFFF" />
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="0" Value="#6BFFFFFF" />
                                                        </ColorAnimationUsingKeyFrames>
                                                        <ColorAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                            <SplineColorKeyFrame KeyTime="0" Value="#F4FFFFFF" />
                                                        </ColorAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                                                        </DoubleAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <!--Start UI-->
                                        <Grid Height="18" Width="19" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0" Background="#11FFFFFF" Cursor="Hand">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="20*" />
                                                <ColumnDefinition Width="20*" />
                                                <ColumnDefinition Width="20*" />
                                                <ColumnDefinition Width="20*" />
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="23*" />
                                                <RowDefinition Height="19*" />
                                                <RowDefinition Height="19*" />
                                                <RowDefinition Height="19*" />
                                            </Grid.RowDefinitions>
                                            <Border x:Name="Background" Grid.ColumnSpan="4" Grid.Row="1" Grid.RowSpan="3" BorderThickness="1" BorderBrush="#FFFFFFFF" Background="#FF1F3B53" Opacity="1" Margin="0,-1,0,0"/>
                                            <Border x:Name="BackgroundGradient" Margin="0,-1,0,0" Grid.ColumnSpan="4" Grid.Row="1" Grid.RowSpan="3" BorderThickness="1" CornerRadius="0" BorderBrush="#FFB4B4B4" Opacity="1">
                                                <Border.Background>
                                                    <LinearGradientBrush StartPoint=".7,0" EndPoint=".7,1">
                                                        <GradientStop Color="#FFFFFFFF" Offset="0" />
                                                        <GradientStop Color="#F9FFFFFF" Offset="0.375" />
                                                        <GradientStop Color="#E5FFFFFF" Offset="0.625" />
                                                        <GradientStop Color="#C6FFFFFF" Offset="1" />
                                                    </LinearGradientBrush>
                                                </Border.Background>
                                            </Border>
                                            <Rectangle Grid.ColumnSpan="4" Grid.RowSpan="1" StrokeThickness="1">
                                                <Rectangle.Stroke>
                                                    <LinearGradientBrush EndPoint="0.48,-1" StartPoint="0.48,1.25">
                                                        <GradientStop Color="#FF494949" />
                                                        <GradientStop Color="#FF9F9F9F" Offset="1" />
                                                    </LinearGradientBrush>
                                                </Rectangle.Stroke>
                                                <Rectangle.Fill>
                                                    <LinearGradientBrush EndPoint="0.3,-1.1" StartPoint="0.46,1.6">
                                                        <GradientStop Color="#FFFF5277" />
                                                        <GradientStop Color="#FFFFDDE4" Offset="1" />
                                                    </LinearGradientBrush>
                                                </Rectangle.Fill>
                                            </Rectangle>
                                            <Path HorizontalAlignment="Center" Margin="4,3,4,3" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" Grid.Column="0" Grid.Row="1" Fill="#FF2F2F2F" Stretch="Fill" Data="M11.426758,8.4305077 L11.749023,8.4305077 L11.749023,16.331387 L10.674805,16.331387 L10.674805,10.299648 L9.0742188,11.298672 L9.0742188,10.294277 C9.4788408,10.090176 9.9094238,9.8090878 10.365967,9.4510155 C10.82251,9.0929432 11.176106,8.7527733 11.426758,8.4305077 z M14.65086,8.4305077 L18.566387,8.4305077 L18.566387,9.3435936 L15.671368,9.3435936 L15.671368,11.255703 C15.936341,11.058764 16.27293,10.960293 16.681133,10.960293 C17.411602,10.960293 17.969301,11.178717 18.354229,11.615566 C18.739157,12.052416 18.931622,12.673672 18.931622,13.479336 C18.931622,15.452317 18.052553,16.438808 16.294415,16.438808 C15.560365,16.438808 14.951641,16.234707 14.468243,15.826504 L14.881817,14.929531 C15.368796,15.326992 15.837872,15.525723 16.289043,15.525723 C17.298809,15.525723 17.803692,14.895514 17.803692,13.635098 C17.803692,12.460618 17.305971,11.873379 16.310528,11.873379 C15.83071,11.873379 15.399232,12.079271 15.016094,12.491055 L14.65086,12.238613 z" Grid.ColumnSpan="4" Grid.RowSpan="3" />
                                            <Ellipse HorizontalAlignment="Center" VerticalAlignment="Center" Fill="#FFFFFFFF" StrokeThickness="0" Grid.ColumnSpan="4" Width="3" Height="3" />
                                            <Border Grid.ColumnSpan="4" Grid.RowSpan="4" BorderThickness="1" BorderBrush="#B2FFFFFF" Opacity="0" x:Name="DisabledVisual" />
                                        </Grid>
                                        <!--End UI-->
                                    </Grid>
                                </ControlTemplate>
                            </Grid.Resources>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal" />
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="DisabledVisual" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="ValidationStates">
                                    <VisualState x:Name="Valid" />
                                    <VisualState x:Name="InvalidUnfocused">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="InvalidFocused">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationErrorElement" Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsOpen">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <sys:Boolean>True</sys:Boolean>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <controlsPrimitives:DatePickerTextBox x:Name="TextBox" SelectionBackground="{TemplateBinding SelectionBackground}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"/>
                            <Border x:Name="ValidationErrorElement" BorderThickness="1" CornerRadius="1" BorderBrush="#FFDB000C" Visibility="Collapsed">
                                <ToolTipService.ToolTip>
                                    <ToolTip x:Name="validationTooltip" Placement="Right" PlacementTarget="{Binding ElementName=TextBox}" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                                        <ToolTip.Triggers>
                                            <EventTrigger RoutedEvent="Canvas.Loaded">
                                                <EventTrigger.Actions>
                                                    <BeginStoryboard>
                                                        <Storyboard>
                                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible">
                                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                                    <DiscreteObjectKeyFrame.Value>
                                                                        <sys:Boolean>true</sys:Boolean>
                                                                    </DiscreteObjectKeyFrame.Value>
                                                                </DiscreteObjectKeyFrame>
                                                            </ObjectAnimationUsingKeyFrames>
                                                        </Storyboard>
                                                    </BeginStoryboard>
                                                </EventTrigger.Actions>
                                            </EventTrigger>
                                        </ToolTip.Triggers>
                                    </ToolTip>
                                </ToolTipService.ToolTip>
                                <Grid Width="12" Height="12" HorizontalAlignment="Right" Margin="1,-4,-4,0" VerticalAlignment="Top" Background="Transparent">
                                    <Path Margin="1,3,0,0" Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z" Fill="#FFDC000C" />
                                    <Path Margin="1,3,0,0" Data="M 0,0 L2,0 L 8,6 L8,8" Fill="#FFFFFF" />
                                </Grid>
                            </Border>
                            <Button x:Name="Button" Template="{StaticResource DropDownButtonTemplate}" Grid.Column="1" Width="20" Foreground="{TemplateBinding Foreground}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Margin="2,0,2,0" />
                            <Grid x:Name="DisabledVisual" Opacity="0" IsHitTestVisible="False" Grid.ColumnSpan="2">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Rectangle RadiusX="1" RadiusY="1" Fill="#8CFFFFFF" />
                                <Rectangle RadiusX="1" RadiusY="1" Fill="#8CFFFFFF" Grid.Column="1" Height="18" Width="19" Margin="2,0,2,0" />
                            </Grid>
                            <Popup x:Name="Popup" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    </UserControl.Resources>
    <!--/////////////////////////-->
    <!--/////////////////////////-->
    <!--/////////////////////////-->
    <!--/////////////////////////-->
    <!--/////////////////////////-->
    <!--/////////////////////////-->
    <Grid x:Name="LayoutRoot">

        <sdk:TabControl Style="{StaticResource ResourceKey=SwitchTopCenterStyle}" TabStripPlacement="Top">
            <sdk:TabItem Style="{StaticResource ResourceKey=SwitchTabItemTopCenterTemplate}" Header="头像更换">
                <Grid>
                    <Button Content="上传头像" HorizontalAlignment="Center" VerticalAlignment="Center" Width="75"/>
                </Grid>
            </sdk:TabItem>
            <sdk:TabItem Style="{StaticResource ResourceKey=SwitchTabItemTopCenterTemplate}" Header="个人信息">
                <Grid Margin="40">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="1*"/>
                        <RowDefinition Height="1*"/>
                        <RowDefinition Height="1*"/>
                        <RowDefinition Height="1*"/>
                        <RowDefinition Height="1*"/>
                        <RowDefinition Height="1*"/>
                        <RowDefinition Height="1*"/>
                        <RowDefinition Height="1*"/>
                        <RowDefinition Height="1*"/>
                        <RowDefinition Height="2*"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="1*"/>
                        <ColumnDefinition Width="1*"/>
                        <ColumnDefinition Width="1*"/>
                        <ColumnDefinition Width="1*"/>
                        <ColumnDefinition Width="1*"/>
                    </Grid.ColumnDefinitions>
                    <sdk:Label Content="年龄：" VerticalAlignment="Top"/>
                    <ComboBox Grid.Column="1" Style="{StaticResource ResourceKey=GenericCBStyle}" VerticalAlignment="Top" Height="24"/>
                    <sdk:Label Grid.Column="3" Content="性别：" VerticalAlignment="Top"/>
                    <ComboBox Grid.Column="4" Style="{StaticResource ResourceKey=GenericCBStyle}" VerticalAlignment="Top" Height="24"/>
                    <sdk:Label Grid.Row="1" Content="血型：" VerticalAlignment="Top"/>
                    <ComboBox x:Name="BloodTypeCB" Grid.Row="1" Grid.Column="1" Style="{StaticResource ResourceKey=GenericCBStyle}" VerticalAlignment="Top" Height="24" Loaded="BloodTypeCB_Loaded"/>
                    <sdk:Label Grid.Row="1" Grid.Column="3" Content="出生年月日：" VerticalAlignment="Top"/>
                    <sdk:DatePicker Grid.Column="4" Grid.Row="1" Style="{StaticResource GenericDataPickerStyle}" Height="24" VerticalAlignment="Top"/>
                    <sdk:Label Grid.Row="2" Content="星座：" VerticalAlignment="Top"/>
                    <ComboBox Grid.Row="2" Grid.Column="1" Style="{StaticResource ResourceKey=GenericCBStyle}" VerticalAlignment="Top" Height="24"/>
                    <sdk:Label Grid.Row="2" Grid.Column="3" Content="所在地：" VerticalAlignment="Top"/>
                    <Extensions:EditableComboBox Grid.Row="2" Grid.Column="4" Style="{StaticResource ResourceKey=GenericECBStyle}" VerticalAlignment="Top" Height="24" IsEditable="True"/>
                    <Line Grid.Row="3" Grid.ColumnSpan="3" Grid.Column="1" X1="0" X2="4000" Y1="0" Y2="0" Stretch="Fill" Stroke="#FFB4B4B4" StrokeDashArray="8,3" VerticalAlignment="Top"/>
                    <sdk:Label Grid.Row="4" Content="使用系统：" VerticalAlignment="Top"/>
                    <Extensions:EditableComboBox Grid.Row="4" Grid.Column="1" Style="{StaticResource ResourceKey=GenericECBStyle}" VerticalAlignment="Top" Height="24" IsEditable="True"/>
                    <sdk:Label Grid.Row="4" Grid.Column="2" Content="作画软件：" VerticalAlignment="Top" HorizontalAlignment="Right"/>
                    <TextBox Grid.Row="4" Grid.Column="3" Grid.RowSpan="2" Style="{StaticResource ResourceKey=InputTBoxStyle}" Margin="18,0,0,15" Grid.ColumnSpan="2"/>
                    <sdk:Label Grid.Row="5" Content="画板型号：" VerticalAlignment="Top"/>
                    <Extensions:EditableComboBox Grid.Row="5" Grid.Column="1" Style="{StaticResource ResourceKey=GenericECBStyle}" VerticalAlignment="Top" Height="24" IsEditable="True"/>
                    <sdk:Label Grid.Row="6" Grid.Column="2" Content="桌上环境：" VerticalAlignment="Top" HorizontalAlignment="Right"/>
                    <TextBox Grid.Row="6" Grid.Column="3" Grid.RowSpan="2" Style="{StaticResource ResourceKey=InputTBoxStyle}" Margin="18,0,0,15" Grid.ColumnSpan="2"/>
                    <sdk:Label Grid.Row="7" Content="作画是听些什么：" VerticalAlignment="Top"/>
                    <TextBox Grid.Column="1" Grid.Row="7" Grid.RowSpan="2" Grid.ColumnSpan="2"  Style="{StaticResource ResourceKey=InputTBoxStyle}" Margin="0,0,5,0"/>



                </Grid>
            </sdk:TabItem>
            <sdk:TabItem Style="{StaticResource ResourceKey=SwitchTabItemTopCenterTemplate}" Header="保密设置">
                <Grid/>
            </sdk:TabItem>
            <sdk:TabItem Style="{StaticResource ResourceKey=SwitchTabItemTopCenterTemplate}" Header="修改密码">
                <Grid/>
            </sdk:TabItem>
        </sdk:TabControl>

    </Grid>
</UserControl>
